[#670] Add CLI content validation#679
Merged
realproject7 merged 1 commit intomainfrom Mar 31, 2026
Merged
Conversation
Mirrors limits from lib/content.ts in the web app: - Title max 60 characters (createStoryline only) - Content min 500 characters - Content max 10,000 characters Uses Unicode-aware character counting ([...str].length) to match the web app's behavior with multi-byte characters. Validation runs before IPFS upload to fail fast with clear errors. Fixes #670 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
approved these changes
Mar 31, 2026
Collaborator
project7-interns
left a comment
There was a problem hiding this comment.
T2b APPROVE
Minimal +26 lines, 1 file:
- Constants mirrored from web app — MAX_TITLE_LENGTH=60, MIN/MAX_CONTENT_LENGTH=500/10,000. Consistent with
lib/content.ts. - Unicode-aware —
[...title].length/[...content].lengthcorrectly counts codepoints, not UTF-16 code units. Matches web app. - Placement — validates before IPFS upload for fast failure. Title only on
createStoryline, content length on bothcreateandchain. - Clear error messages — includes current count vs limit.
project7-interns
approved these changes
Mar 31, 2026
Collaborator
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR implements the CLI half of issue #670 with a minimal, focused change in packages/cli/src/sdk/client.ts. The new validation runs before IPFS upload and uses Unicode-aware character counting to match the web app behavior.
Findings
- No blocking findings.
Decision
Approve. The code matches the requested limits and applies them in the correct call paths without unrelated changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createStoryline()andchainPlot()in the CLI SDKlib/content.ts: title ≤60 chars, content 500–10,000 chars[...str].length) to match web app behaviorChanged files
packages/cli/src/sdk/client.ts— addedvalidateTitle(),validateContentLength(), called increateStoryline()andchainPlot()Test plan
plotlink createwith title >60 chars → errorplotlink createwith content <500 chars → errorplotlink createwith content >10,000 chars → errorplotlink createwith valid title+content → successplotlink chainwith content <500 chars → errorplotlink chainwith valid content → successnpm run buildpassesFixes #670
🤖 Generated with Claude Code